import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '拼包车/产品',
    align:"center",
    dataIndex: 'typeId_dictText'
   },
   {
    title: '租户',
    align:"center",
    sorter: true,
    dataIndex: 'tenantNum'
   },
   {
    title: '总时间',
    align:"center",
    sorter: true,
    dataIndex: 'dayNum'
   },
   {
    title: '代理商',
    align:"center",
    sorter: true,
    dataIndex: 'agentNum'
   },
   {
    title: '领队',
    align:"center",
    sorter: true,
    dataIndex: 'guideNum'
   },
   {
    title: '购买次数',
    align:"center",
    sorter: true,
    dataIndex: 'buyUserNum'
   },
   {
    title: '活动',
    align:"center",
    sorter: true,
    dataIndex: 'activityNum'
   },
   {
    title: '产品',
    align:"center",
    sorter: true,
    dataIndex: 'pdtNum'
   },
   {
    title: '发车次数',
    align:"center",
    sorter: true,
    dataIndex: 'cartNum'
   },
   {
    title: '订单数量',
    align:"center",
    sorter: true,
    dataIndex: 'orderNum'
   },
   {
    title: '商家',
    align:"center",
    sorter: true,
    dataIndex: 'shopNum'
   },
   {
    title: '每周活动产品',
    align:"center",
    sorter: true,
    dataIndex: 'weekNum'
   },
   {
    title: '销售金额',
    align:"center",
    sorter: true,
    dataIndex: 'sellPrice'
   },
   {
    title: '退款金额',
    align:"center",
    sorter: true,
    dataIndex: 'refundPrice'
   },
   {
    title: '佣金金额',
    align:"center",
    sorter: true,
    dataIndex: 'commissionPrice'
   },
   {
    title: '已提现佣金',
    align:"center",
    sorter: true,
    dataIndex: 'yiCommission'
   },
   {
    title: '未提现佣金',
    align:"center",
    sorter: true,
    dataIndex: 'weiCommission'
   },
   {
    title: '城市',
    align:"center",
    dataIndex: 'cityId'
   },
   {
    title: '租户',
    align:"center",
    dataIndex: 'tenantId'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "拼包车/产品",
      field: "typeId",
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"statistice_order_pdt_type"
      },
      //colProps: {span: 6},
 	},
	{
      label: "城市",
      field: "cityId",
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "租户",
      field: "tenantId",
      component: 'Input',
      //colProps: {span: 6},
 	},
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '拼包车/产品',
    field: 'typeId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"statistice_order_pdt_type"
     },
  },
  {
    label: '租户',
    field: 'tenantNum',
    component: 'InputNumber',
  },
  {
    label: '总时间',
    field: 'dayNum',
    component: 'InputNumber',
  },
  {
    label: '代理商',
    field: 'agentNum',
    component: 'InputNumber',
  },
  {
    label: '领队',
    field: 'guideNum',
    component: 'InputNumber',
  },
  {
    label: '购买次数',
    field: 'buyUserNum',
    component: 'InputNumber',
  },
  {
    label: '活动',
    field: 'activityNum',
    component: 'InputNumber',
  },
  {
    label: '产品',
    field: 'pdtNum',
    component: 'InputNumber',
  },
  {
    label: '发车次数',
    field: 'cartNum',
    component: 'InputNumber',
  },
  {
    label: '订单数量',
    field: 'orderNum',
    component: 'InputNumber',
  },
  {
    label: '商家',
    field: 'shopNum',
    component: 'InputNumber',
  },
  {
    label: '每周活动产品',
    field: 'weekNum',
    component: 'InputNumber',
  },
  {
    label: '销售金额',
    field: 'sellPrice',
    component: 'InputNumber',
  },
  {
    label: '退款金额',
    field: 'refundPrice',
    component: 'InputNumber',
  },
  {
    label: '佣金金额',
    field: 'commissionPrice',
    component: 'InputNumber',
  },
  {
    label: '已提现佣金',
    field: 'yiCommission',
    component: 'InputNumber',
  },
  {
    label: '未提现佣金',
    field: 'weiCommission',
    component: 'InputNumber',
  },
  {
    label: '城市',
    field: 'cityId',
    component: 'Input',
  },
  {
    label: '租户',
    field: 'tenantId',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

//子表列表数据
export const coupleStatisticsCityDayColumns: BasicColumn[] = [
   {
    title: '拼包车/产品',
    align:"center",
    dataIndex: 'typeId_dictText'
   },
   {
    title: '租户',
    align:"center",
    sorter: true,
    dataIndex: 'tenantNum'
   },
   {
    title: '总时间',
    align:"center",
    sorter: true,
    dataIndex: 'dayNum'
   },
   {
    title: '代理商',
    align:"center",
    sorter: true,
    dataIndex: 'agentNum'
   },
   {
    title: '领队',
    align:"center",
    sorter: true,
    dataIndex: 'guideNum'
   },
   {
    title: '购买次数',
    align:"center",
    sorter: true,
    dataIndex: 'buyUserNum'
   },
   {
    title: '活动',
    align:"center",
    sorter: true,
    dataIndex: 'activityNum'
   },
   {
    title: '产品',
    align:"center",
    sorter: true,
    dataIndex: 'pdtNum'
   },
   {
    title: '发车次数',
    align:"center",
    sorter: true,
    dataIndex: 'cartNum'
   },
   {
    title: '订单数量',
    align:"center",
    sorter: true,
    dataIndex: 'orderNum'
   },
   {
    title: '商家',
    align:"center",
    sorter: true,
    dataIndex: 'shopNum'
   },
   {
    title: '每周活动产品',
    align:"center",
    sorter: true,
    dataIndex: 'weekNum'
   },
   {
    title: '销售金额',
    align:"center",
    sorter: true,
    dataIndex: 'sellPrice'
   },
   {
    title: '退款金额',
    align:"center",
    sorter: true,
    dataIndex: 'refundPrice'
   },
   {
    title: '佣金金额',
    align:"center",
    sorter: true,
    dataIndex: 'commissionPrice'
   },
   {
    title: '已提现佣金',
    align:"center",
    sorter: true,
    dataIndex: 'yiCommission'
   },
   {
    title: '未提现佣金',
    align:"center",
    sorter: true,
    dataIndex: 'weiCommission'
   },
   {
    title: '日期',
    align:"center",
    sorter: true,
    dataIndex: 'mainId'
   },
   {
    title: '日期',
    align:"center",
    dataIndex: 'day'
   },
   {
    title: '城市',
    align:"center",
    dataIndex: 'cityId'
   },
   {
    title: '租户',
    align:"center",
    dataIndex: 'tenantId_dictText'
   },
];
//子表表单数据
export const coupleStatisticsCityDayFormSchema: FormSchema[] = [
  // TODO 子表隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false
  },
  {
    label: '拼包车/产品',
    field: 'typeId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"statistice_order_pdt_type"
     },
  },
  {
    label: '租户',
    field: 'tenantNum',
    component: 'InputNumber',
  },
  {
    label: '总时间',
    field: 'dayNum',
    component: 'InputNumber',
  },
  {
    label: '代理商',
    field: 'agentNum',
    component: 'InputNumber',
  },
  {
    label: '领队',
    field: 'guideNum',
    component: 'InputNumber',
  },
  {
    label: '购买次数',
    field: 'buyUserNum',
    component: 'InputNumber',
  },
  {
    label: '活动',
    field: 'activityNum',
    component: 'InputNumber',
  },
  {
    label: '产品',
    field: 'pdtNum',
    component: 'InputNumber',
  },
  {
    label: '发车次数',
    field: 'cartNum',
    component: 'InputNumber',
  },
  {
    label: '订单数量',
    field: 'orderNum',
    component: 'InputNumber',
  },
  {
    label: '商家',
    field: 'shopNum',
    component: 'InputNumber',
  },
  {
    label: '每周活动产品',
    field: 'weekNum',
    component: 'InputNumber',
  },
  {
    label: '销售金额',
    field: 'sellPrice',
    component: 'InputNumber',
  },
  {
    label: '退款金额',
    field: 'refundPrice',
    component: 'InputNumber',
  },
  {
    label: '佣金金额',
    field: 'commissionPrice',
    component: 'InputNumber',
  },
  {
    label: '已提现佣金',
    field: 'yiCommission',
    component: 'InputNumber',
  },
  {
    label: '未提现佣金',
    field: 'weiCommission',
    component: 'InputNumber',
  },
  {
    label: '日期',
    field: 'mainId',
    component: 'Input',
  },
  {
    label: '日期',
    field: 'day',
    component: 'Input',
  },
  {
    label: '城市',
    field: 'cityId',
    component: 'Input',
  },
  {
    label: '租户',
    field: 'tenantId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"sys_tenant,name,id"
    },
  },
];
